package com.province.platform.core.communication;

import com.province.platform.core.enums.State;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Communication {
    /**
     * 所有的数值key-value对 *
     */
    private Map<String, Number> counter;

    /**
     * 运行状态
     */
    private State state;

    /**
     * task给job的信息
     */
    Map<String, List<String>> message;

    /**
     * 异常记录
     */
    private Throwable throwable;

    public Communication() {
        this.init();
    }

    public synchronized void  reset() {
        this.init();
    }

    private void init() {
        this.counter = new ConcurrentHashMap<>();
        this.state = State.RUNNING;
        this.throwable = null;
        this.message = new ConcurrentHashMap<>();
    }
}
